package com.qingchunlin.blogsystem.service;

import com.qingchunlin.blogsystem.entity.Blog;
import com.qingchunlin.blogsystem.mapper.BlogMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class BlogService {
    @Autowired
    private BlogMapper blogMapper;

    public List<Blog> getBlogList() {
        return blogMapper.getBlogList();
    }

    public Blog getBlogDetail(Integer blogId) {
        return blogMapper.getBlogDetail(blogId);
    }

    public void insertBlog(Blog blog) {
        blogMapper.insertBlog(blog);
    }

    public Integer updateBlog(Blog blog) {
        return blogMapper.updateBlog(blog);
    }

    public Integer deleteBlog(Integer blogId) {
        return blogMapper.deleteBlog(blogId);
    }
}
